const session = window.sessionStorage
const local = window.localStorage

const setValue = (v) => (typeof v === 'object' && v !== null ? JSON.stringify(v) : v)

const ENTRY_key = 'entryManu_issueDirective'
const MANUE_EFFECT_key = 'entryManu_effectAssess'

/* 入池稿件 进入下发指令 的数据 */
export const getEntryManuIssue = () => JSON.parse(session.getItem(ENTRY_key) || '[]')
export const setEntryManuIssue = (val) => session.setItem(ENTRY_key, setValue(val))

/* 入池稿件 进入稿件效果评估 的数据 */
export const getEntryManuEffect = () => JSON.parse(session.getItem(MANUE_EFFECT_key) || '{}')
export const setEntryManuEffect = (val) => session.setItem(MANUE_EFFECT_key, setValue(val))

/* 设置用户信息 */
export const getUserInfo = () => JSON.parse(session.getItem('userInfo') || '{}')
export const setUserInfo = (val) => session.setItem('userInfo', setValue(val))